<?php

/*
 * Edit by shengxin
 * Click nbfs://nbhost/SystemFileSystem/Templates/Scripting/PHPClass.php to edit this template
 */
namespace api\mall\task;
use api\mall\model\IMSessionModel;
/**
 * Description of OnlineTask
 *
 * @author PC
 */
class TalkTask extends BaseTask{
    
    public function check_comp($task) {
        $model = new IMSessionModel();
        $userid = $task['user_id'];
        $last_talk = $model->where('send_user_id',$userid)->where('receive_user_id','>',0)->where('session_status',0)->order('update_time desc')->find();
        if($last_talk){
            $today = date('Y-m-d');
            $date2 = date('Y-m-d',$last_talk->update_time);
            if($date2==$today){
                return true;
            }
        }
        return false;
    }
}
